# Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
# Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
pkgname=cdogs-sdl
pkgver=2.1.0
pkgrel=0
pkgdesc="Classic overhead run-and-gun game"
url="https://cxong.github.io/cdogs-sdl/"
arch="all"
license="GPL-2.0-or-later AND BSD-2-Clause"
makedepends="
	cmake
	gtk+3.0-dev
	mesa-dev
	samurai
	sdl2-dev
	sdl2_image-dev
	sdl2_mixer-dev
	"
options="!check" #make check not implemented
source="$pkgname-$pkgver.tar.gz::https://github.com/cxong/cdogs-sdl/archive/$pkgver.tar.gz
	no-werror.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr/share/cdogs-sdl/ \
		-DCDOGS_DATA_DIR=/usr/share/cdogs-sdl/ \
		-DCMAKE_BUILD_TYPE=None \
		-Wno-dev
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	mv "$pkgdir"/usr/share/cdogs-sdl/bin/ "$pkgdir"/usr/bin/
	mv "$pkgdir"/usr/share/cdogs-sdl/share/* "$pkgdir"/usr/share/
}

sha512sums="
92b82a94cd73c7e33e141878db6ee71ca1e164a41c79e0c575aa02f4121506496e2e8e6bbef1eb239c7b145b90c0a49c3f31f4cc6d8817f75e91f5554b6d6d05  cdogs-sdl-2.1.0.tar.gz
d4eedbfe425d659ee3fff0203f2dd49640da394db895964416ea86a98f601ee8136ac129f1c3c48b9bd525bf5e34854a861bfc881fb997ae7c61a01227137a89  no-werror.patch
"
